import request from '@/utils/request'

// 所有年级
export function getALlGrade() {
  return request({
    url: '/grade/allGrade',
    method: 'get'
  })
}

// 老师管理班级
export function getManageList(data) {
  return request({
    url: '/measuremanage/queryClassOfTeacher',
    method: 'get',
    params: {
      grade: data.grade,
      teacherId: data.teacherId,
      name: data.name,
      page: data.page,
      limit: '10'
    }
  })
}

// 班级下所有学生
export function getStudentList(data) {
  return request({
    url: '/measuremanage/queryStudentOfClass',
    method: 'get',
    params: {
      classId: data.classId,
      limit: '10',
      studentName: data.studentName,
      page: data.pages
    }
  })
}

// 学生的具体措施管理
export function getStudentManageDetail(data) {
  return request({
    url: '/measuremanage/query',
    method: 'get',
    params: {
      crop: data.crop,
      studentId: data.studentId
    }
  })
}

// 新增学生具体措施管理
export function postStudentManageDetail(data) {
  return request({
    url: '/measuremanage/insert',
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data
  })
}

// 删除具体措施管理
export function deletStudentManageDetail(id) {
  return request({
    url: `/measuremanage/delete/${id}`,
    method: 'delete'
  })
}

// 修改具体管理措施
export function putStudentManageDetail(data) {
  return request({
    url: '/measuremanage/update',
    method: 'put',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data
  })
}

// 获取措施列表
export function getMeasureList() {
  return request({
    url: '/measure/page',
    method: 'get',
  })
}

// 获取作物列表
export function getCropList() {
  return request({
    url: '/crop/page',
    method: 'get',
  })
}